using System.Web.Mvc;
using Limestone;

namespace SampleSite.Areas.Limestone.Controllers
{
    public class HomeController : Controller
    {
        private readonly IStorage _storage;
        private readonly IPageStubCache _pageStubCache;

        public HomeController(IStorage storage, IPageStubCache pageStubCache)
        {
            _storage = storage;
            _pageStubCache = pageStubCache;
        }

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult Contact()
        {
            return View();
        }

        public ActionResult RebuildLookup()
        {
            _storage.GetPageLookUp(true);
            return View("Index");
        }

        public ActionResult ClearPageStubCache()
        {
            _pageStubCache.LoadPageLookUpCache(true);
            return View("Index");
        }
    }
}